﻿@model IEnumerable<blacksoft.Models.Persona>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_LayoutVentas.cshtml";
}

@if (TempData["create_success"] != null)
{
    <div class="success grid_12">
        <h3>Nuevo: @TempData["create_success"].</h3>
        <a class="hide_btn" href="#"></a>
    </div>
}
else if (TempData["edit_success"] != null)
{
    <div class="success grid_12">
        <h3>Modificar: @TempData["edit_success"].</h3>
        <a class="hide_btn" href="#"></a>
    </div>
}
else if (TempData["delete_success"] != null)
{
    <div class="success grid_12">
        <h3>Eliminar: @TempData["delete_success"].</h3>
        <a class="hide_btn" href="#"></a>
    </div>
}

@if (TempData["create_failure"] != null)
{
    <div class="error grid_12">
        <h3>Nuevo: @TempData["create_fail"].</h3>
        <a class="hide_btn" href="#"></a>
    </div>
}
else if (TempData["details_failure"] != null)
{
    <div class="error grid_12">
        <h3>Detalle: @TempData["create_fail"].</h3>
        <a class="hide_btn" href="#"></a>
    </div>
}
else if (TempData["edit_failure"] != null)
{
    <div class="error grid_12">
        <h3>Modificar: @TempData["edit_fail"].</h3>
        <a class="hide_btn" href="#"></a>
    </div>
}
else if (TempData["delete_failure"] != null)
{
    <div class="error grid_12">
        <h3>Eliminar: @TempData["delete_fail"].</h3>
        <a class="hide_btn" href="#"></a>
    </div>
}


<div class="block big">
    <div class="titlebar">
        <h3>Cliente</h3>
    </div>
    <div class="block_cont">
        <a href="/Cliente/Create" class="navbutton">
            <span class="icon_plus">
                Nuevo Cliente
            </span>
        </a>
        <table class="data-table">
            <thead>
                <tr>
                    <th>
                        @Html.DisplayNameFor(model => model.Nombre)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.ApellidoPaterno)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.ApellidoMaterno)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.DNI)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.FechaNacimiento)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.Direccion)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.Telefono)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.Email)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.Celular)
                    </th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                {
                    <tr style="color:black !important;">
                        <td>
                            @Html.DisplayFor(modelItem => item.Nombre)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.ApellidoPaterno)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.ApellidoMaterno)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.DNI)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.FechaNacimiento)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.Direccion)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.Telefono)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.Email)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.Celular)
                        </td>

                        <td>
                            <div style="height: 3px;"></div>
                            <div class="actionbar">
                                <a href=@string.Concat("/Cliente/Edit/", item.IDPersona) class="action edit"><span>Modificar</span></a>
                                <a href=@string.Concat("/Cliente/Delete/", item.IDPersona) class="action delete"><span>Eliminar</span></a>
                            </div>
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
</div>